<?php

namespace app\api\controller;

use app\common\controller\Api;
use app\api\service\ThirdService;

class Third extends Api
{

    // 无需登录的接口,*表示全部
    protected $noNeedLogin = ['wechat_login','bind_mobile'];
    // 无需鉴权的接口,*表示全部
    protected $noNeedRight = ['*'];

    // 微信一键登录①code换openid
    public function wechat_login()
    {
        $data = $this->request->post();
//        return json($code);
        $res = ThirdService::wechat_login($data);
        return json($res);
    }

    // 微信一键登录②绑定手机号
    public function bind_mobile()
    {
        $data = $this->request->post();
        $res = ThirdService::bind_mobile($data);
        return json($res);
    }

    // 绑定微信
    public function bind_wechat()
    {
        $data = $this->request->post();
        $res = ThirdService::bind_wechat($data);
        return json($res);
    }





}
